<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>指定窗口大小</title>
</head>

<body>
    <button onclick="openwindow()">创建窗口</button>
    <button onclick="myFunction()">调整窗口</button>
    <script>
        var w;
        function openwindow() {
            w = window.open('', '', 'width=100,height=100');
            w.focus();
        }
        function myFunction() {
            w.resizeTo(500, 500);
            w.focus();
        }
    </script>
</body>

</html>